<template>
<transition name="slide">
  <div class="wrap" v-if="showModal">
    <!--  遮罩层-->
    <div class="mask"></div>
    <!--  内容区-->
    <div class="modal-dialog">
      <div class="modal-head">
        <span>{{title}}</span>
        <a href="jacascript:;" @click="shutModal"></a>
      </div>
      <div class="modal-body">
        <slot name="body">
        </slot>
      </div>
      <div class="modal-footer">
        <a href="javascript:;" class="btn">{{sureText}}</a>
      </div>
    </div>
  </div>
</transition>
</template>

<script>
export default {
  props:{
    // 弹框类型：小small、中middle、大large、表单form
    modalType:{
      type:String,
      default:'form'
    },
    // 弹框标题
    title:{
      type:String,
      default: '提示'
    },
    // 默认按钮
    btnType:String,
    // 确定按钮按钮
    sureText:{
      type:String,
      default: '确定'
    },
    // 取消按钮
    cancelText:{
      type:String,
      default:'取消'
    },
    showModal:Boolean
  },
  name: "Modal",
  methods:{
    shutModal(){
      this.$emit('shutModal')
    }
  }
}
</script>

<style lang="scss" scoped>
@import "../../assets/scss/mixin.scss";
@import "../../assets/scss/config.scss";
@import "../../assets/scss/button.scss";
@import "../../assets/scss/modal.scss";
//.wrap{
//  position: fixed;
//}
</style>
